package com.atguigu.dga.governance.assessor.spec;

import com.atguigu.dga.constant.DgaConstant;
import com.atguigu.dga.governance.assessor.Assessor;
import com.atguigu.dga.governance.bean.AssessParam;
import com.atguigu.dga.governance.bean.GovernanceAssessDetail;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * ClassName: BusiOwnerAssessor
 * Package: com.atguigu.dga.governance.assessor
 * Description:
 *
 * @Author:
 * @Create: 2024/3/16 14:43
 * @Version: 1.0
 */
@Component("BUSI_OWNER")
public class BusiOwnerAssessor extends Assessor {
    @Override
    public void checkProblem(AssessParam assessParam, GovernanceAssessDetail governanceAssessDetail) {

        // 判断是否为空或者unset
        String busiOwnerUserName = assessParam.getTableMetaInfo().getTableMetaInfoExtra().getBusiOwnerUserName();
        if(busiOwnerUserName == null || DgaConstant.TEC_OWNER_UNSET.equals(busiOwnerUserName)){
            governanceAssessDetail.setAssessScore(BigDecimal.ZERO);
            governanceAssessDetail.setAssessProblem("未设定业务负责人");
        }
    }
    //    @Override
//    public void doAssess() {
//        System.out.println("busi");
//    }
}
